namespace ext
{
	using System;
	using System.Runtime.CompilerServices;
	using System.Html;
	using System.Collections;
	
	
	/// <summary>
	/// Handles mapping keys to actions for an element. One key map can be used for multiple actions.
	/// The constructor accepts the same config object as defined by {@link #addBinding}.
	/// If you bind a callback function to a KeyMap, anytime the KeyMap handles an expected key
	/// combination it will call the function with this signature (if the match is a multi-key
	/// combination the callback will still be called only once): (String key, Ext.EventObject e)
	/// A KeyMap can also handle a string representation of keys. 
	/// Usage:
	/// 
	/// // map one key by key code
	/// var map = new Ext.KeyMap(&quot;my-element&quot;, {
	/// key: 13, // or Ext.EventObject.ENTER
	/// fn: myHandler,
	/// scope: myObject
	/// });
	///
	/// // map multiple keys to one action by string
	/// var map = new Ext.KeyMap(&quot;my-element&quot;, {
	/// key: &quot;a\r\n\t&quot;,
	/// fn: myHandler,
	/// scope: myObject
	/// });
	///
	/// // map multiple keys to multiple actions by strings and array of codes
	/// var map = new Ext.KeyMap(&quot;my-element&quot;, [
	/// {
	/// key: [10,13],
	/// fn: function(){ alert(&quot;Return was pressed&quot;); }
	/// }, {
	/// ..
	/// </summary>
	/// <htmlSummary>
	/// Handles mapping keys to actions for an element. One key map can be used for multiple actions.
	/// The constructor accepts the same config object as defined by {@link #addBinding}.
	/// If you bind a callback function to a KeyMap, anytime the KeyMap handles an expected key
	/// combination it will call the function with this signature (if the match is a multi-key
	/// combination the callback will still be called only once): (String key, Ext.EventObject e)
	/// A KeyMap can also handle a string representation of keys.&lt;br /&gt;
	/// Usage:
	/// &lt;pre&gt;&lt;code&gt;
	/// // map one key by key code
	/// var map = new Ext.KeyMap(&quot;my-element&quot;, {
	/// key: 13, // or Ext.EventObject.ENTER
	/// fn: myHandler,
	/// scope: myObject
	/// });
	///
	/// // map multiple keys to one action by string
	/// var map = new Ext.KeyMap(&quot;my-element&quot;, {
	/// key: &quot;a\r\n\t&quot;,
	/// fn: myHandler,
	/// scope: myObject
	/// });
	///
	/// // map multiple keys to multiple actions by strings and array of codes
	/// var map = new Ext.KeyMap(&quot;my-element&quot;, [
	/// {
	/// key: [10,13],
	/// fn: function(){ alert(&quot;Return was pressed&quot;); }
	/// }, {
	/// key: &quot;abc&quot;,
	/// fn: function(){ alert(&apos;a, b or c was pressed&apos;); }
	/// }, {
	/// key: &quot;\t&quot;,
	/// ctrl:true,
	/// shift:true,
	/// fn: function(){ alert(&apos;Control + shift + tab was pressed.&apos;); }
	/// }
	/// ]);
	/// &lt;/code&gt;&lt;/pre&gt;
	/// &lt;b&gt;Note: A KeyMap starts enabled&lt;/b&gt;
	/// </htmlSummary>
	/// <definedin>src\util\KeyMap.js</definedin>
	[ScriptName("KeyMap")]
	[ScriptNamespace("Ext")]
	[Imported()]
	public partial class KeyMap
	{
		
		#region Constructors
		/// <summary>Constructor</summary>
		/// <param name="el">The element to bind to</param>
		/// <param name="config">The config (see {@link #addBinding})</param>
		/// <param name="eventName">The event to bind to (defaults to &quot;keydown&quot;)</param>
		public KeyMap(object el, object config, string eventName)
		{
		}
		
		/// <summary>Constructor</summary>
		/// <param name="el">The element to bind to</param>
		/// <param name="config">The config (see {@link #addBinding})</param>
		public KeyMap(object el, object config)
		{
		}
		
		/// <summary>Constructor</summary>
		public KeyMap()
		{
		}
		#endregion
		
		#region Properties
		/// <summary>
		/// True to stop the event from bubbling and prevent the default browser action if the
		/// key was handled by the KeyMap (defaults to false)
		/// </summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		[ScriptName("stopEvent")]
		[IntrinsicProperty()]
		public bool StopEvent
		{
			get
			{
				throw new System.Exception("Imported - not implemented");
			}
			set
			{
			}
		}
		#endregion
		
		#region Methods
		/// <summary>Returns true if this KeyMap is enabled</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		[ScriptName("isEnabled")]
		public bool IsEnabled()
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Enables this KeyMap</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		[ScriptName("enable")]
		public void Enable()
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Disable this KeyMap</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		[ScriptName("disable")]
		public void Disable()
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Convenience function for setting disabled/enabled by boolean.</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		/// <param name="disabled"></param>
		[ScriptName("setDisabled")]
		public void SetDisabled(bool disabled)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>
		/// Add a new binding to this KeyMap. The following config object properties are supported:
		/// 
		/// Property Type Description
		/// ---------- --------------- ----------------------------------------------------------------------
		/// key String/Array A single keycode or an array of keycodes to handle
		/// shift Boolean True to handle key only when shift is pressed, False to handle the key only when shift is not pressed (defaults to undefined)
		/// ctrl Boolean True to handle key only when ctrl is pressed, False to handle the key only when ctrl is not pressed (defaults to undefined)
		/// alt Boolean True to handle key only when alt is pressed, False to handle the key only when alt is not pressed (defaults to undefined)
		/// handler Function The function to call when KeyMap finds the expected key combination
		/// fn Function Alias of handler (for backwards-compatibility)
		/// scope Object The scope of the callback function
		/// stopEvent Boolean True to stop the event from bubbling and prevent the default browser action if...
		/// </summary>
		/// <htmlSummary>
		/// Add a new binding to this KeyMap. The following config object properties are supported:
		/// &lt;pre&gt;
		/// Property Type Description
		/// ---------- --------------- ----------------------------------------------------------------------
		/// key String/Array A single keycode or an array of keycodes to handle
		/// shift Boolean True to handle key only when shift is pressed, False to handle the key only when shift is not pressed (defaults to undefined)
		/// ctrl Boolean True to handle key only when ctrl is pressed, False to handle the key only when ctrl is not pressed (defaults to undefined)
		/// alt Boolean True to handle key only when alt is pressed, False to handle the key only when alt is not pressed (defaults to undefined)
		/// handler Function The function to call when KeyMap finds the expected key combination
		/// fn Function Alias of handler (for backwards-compatibility)
		/// scope Object The scope of the callback function
		/// stopEvent Boolean True to stop the event from bubbling and prevent the default browser action if the key was handled by the KeyMap (defaults to false)
		/// &lt;/pre&gt;
		///
		/// Usage:
		/// &lt;pre&gt;&lt;code&gt;
		/// // Create a KeyMap
		/// var map = new Ext.KeyMap(document, {
		/// key: Ext.EventObject.ENTER,
		/// fn: handleKey,
		/// scope: this
		/// });
		///
		/// //Add a new binding to the existing KeyMap later
		/// map.addBinding({
		/// key: &apos;abc&apos;,
		/// shift: true,
		/// fn: handleKey,
		/// scope: this
		/// });
		/// &lt;/code&gt;&lt;/pre&gt;
		/// </htmlSummary>
		/// <definedin>src\util\KeyMap.js</definedin>
		/// <param name="config">A single KeyMap config or an array of configs</param>
		[ScriptName("addBinding")]
		public void AddBinding(object config)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>
		/// Add a new binding to this KeyMap. The following config object properties are supported:
		/// 
		/// Property Type Description
		/// ---------- --------------- ----------------------------------------------------------------------
		/// key String/Array A single keycode or an array of keycodes to handle
		/// shift Boolean True to handle key only when shift is pressed, False to handle the key only when shift is not pressed (defaults to undefined)
		/// ctrl Boolean True to handle key only when ctrl is pressed, False to handle the key only when ctrl is not pressed (defaults to undefined)
		/// alt Boolean True to handle key only when alt is pressed, False to handle the key only when alt is not pressed (defaults to undefined)
		/// handler Function The function to call when KeyMap finds the expected key combination
		/// fn Function Alias of handler (for backwards-compatibility)
		/// scope Object The scope of the callback function
		/// stopEvent Boolean True to stop the event from bubbling and prevent the default browser action if...
		/// </summary>
		/// <htmlSummary>
		/// Add a new binding to this KeyMap. The following config object properties are supported:
		/// &lt;pre&gt;
		/// Property Type Description
		/// ---------- --------------- ----------------------------------------------------------------------
		/// key String/Array A single keycode or an array of keycodes to handle
		/// shift Boolean True to handle key only when shift is pressed, False to handle the key only when shift is not pressed (defaults to undefined)
		/// ctrl Boolean True to handle key only when ctrl is pressed, False to handle the key only when ctrl is not pressed (defaults to undefined)
		/// alt Boolean True to handle key only when alt is pressed, False to handle the key only when alt is not pressed (defaults to undefined)
		/// handler Function The function to call when KeyMap finds the expected key combination
		/// fn Function Alias of handler (for backwards-compatibility)
		/// scope Object The scope of the callback function
		/// stopEvent Boolean True to stop the event from bubbling and prevent the default browser action if the key was handled by the KeyMap (defaults to false)
		/// &lt;/pre&gt;
		///
		/// Usage:
		/// &lt;pre&gt;&lt;code&gt;
		/// // Create a KeyMap
		/// var map = new Ext.KeyMap(document, {
		/// key: Ext.EventObject.ENTER,
		/// fn: handleKey,
		/// scope: this
		/// });
		///
		/// //Add a new binding to the existing KeyMap later
		/// map.addBinding({
		/// key: &apos;abc&apos;,
		/// shift: true,
		/// fn: handleKey,
		/// scope: this
		/// });
		/// &lt;/code&gt;&lt;/pre&gt;
		/// </htmlSummary>
		/// <definedin>src\util\KeyMap.js</definedin>
		/// <param name="config">A single KeyMap config or an array of configs</param>
		[ScriptName("addBinding")]
		public void AddBinding(System.Array config)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Shorthand for adding a single key listener</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		/// <param name="key">
		/// Either the numeric key code, array of key codes or an object with the
		/// following options:
		/// {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
		/// </param>
		/// <param name="fn">The function to call</param>
		/// <param name="scope">The scope (<c>this</c> reference) in which the function is executed. Defaults to the browser window.</param>
		[ScriptName("on")]
		public void On(System.Number key, System.Delegate fn, object scope)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Shorthand for adding a single key listener</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		/// <param name="key">
		/// Either the numeric key code, array of key codes or an object with the
		/// following options:
		/// {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
		/// </param>
		/// <param name="fn">The function to call</param>
		/// <param name="scope">The scope (<c>this</c> reference) in which the function is executed. Defaults to the browser window.</param>
		[ScriptName("on")]
		public void On(System.Array key, System.Delegate fn, object scope)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Shorthand for adding a single key listener</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		/// <param name="key">
		/// Either the numeric key code, array of key codes or an object with the
		/// following options:
		/// {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
		/// </param>
		/// <param name="fn">The function to call</param>
		/// <param name="scope">The scope (<c>this</c> reference) in which the function is executed. Defaults to the browser window.</param>
		[ScriptName("on")]
		public void On(object key, System.Delegate fn, object scope)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Shorthand for adding a single key listener</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		/// <param name="key">
		/// Either the numeric key code, array of key codes or an object with the
		/// following options:
		/// {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
		/// </param>
		/// <param name="fn">The function to call</param>
		[ScriptName("on")]
		public void On(System.Number key, System.Delegate fn)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Shorthand for adding a single key listener</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		/// <param name="key">
		/// Either the numeric key code, array of key codes or an object with the
		/// following options:
		/// {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
		/// </param>
		/// <param name="fn">The function to call</param>
		[ScriptName("on")]
		public void On(System.Array key, System.Delegate fn)
		{
			throw new System.Exception("Imported - not implemented");
		}
		
		/// <summary>Shorthand for adding a single key listener</summary>
		/// <definedin>src\util\KeyMap.js</definedin>
		/// <param name="key">
		/// Either the numeric key code, array of key codes or an object with the
		/// following options:
		/// {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
		/// </param>
		/// <param name="fn">The function to call</param>
		[ScriptName("on")]
		public void On(object key, System.Delegate fn)
		{
			throw new System.Exception("Imported - not implemented");
		}
		#endregion
	}
}
